﻿using System;
using System.Collections.Generic;
using System.Text;
using ilibrary.source.model;
using Log;

namespace PDFHandler
{
    public class PDFEbook : EBook
    {
        private EventLog log = new EventLog("ILibrary", "PDFEbook");

        public PDFEbook(int id, string filepath):base(id,filepath)
        {
            //on vérifie que c'est bien un fichier PDF
            if (filepath == null || System.IO.Path.GetExtension(filepath).ToLower() != ".pdf")
                throw new NotSupportedException("The file " + filepath + " is not a PDF file.");

        }

        public override bool readToc(IEBookReadingHandler cB)
        {
            try
            {
                throw new NotImplementedException();
            }
            catch (Exception ex)
            {
                this.log.Error("", ex);
            }
            this.toc = string.Empty;
            return false;
        }
        
    }
}
